<?

/*	Text.note OBJECT
*	Methods:
*	output
*
*	Constructor:
*
*
*					*/


class TextNote extends modTEXT {

	function __construct( $vars ) {

		$this->_addvars( $vars );
		$this->_ref();
	}
	
	public function output() {
		
		
		if( $this->action )
			$result = $this->{ "filter_" . $this->action }();
		
		
		if( $result ) $this->class = $this->action;
		
#		push_content puts content after text, parse before
		return $this->parse( $result ) . $this->render_js();
		
	}
	
	public function ajax() {
	
		if( $this->action )
			$result = $this->{ "ajax_" . $this->action }();
			
		return $result;
	
	}
	
	
	private function filter_postit() {
		
		return "Post-it&reg;";
	}
	
	private function ajax_stick() {
		global $DB, $Engine;
		
		$js = "mod = new TextNote( 'stick', ". json_encode( $this->vars ) ." )";
		$js.= "mod.update( ". $DB->smartq(( $textid = $this->vars->textid )? $Engine->text->get( $textid ): $this->vars->string ) ." );";
		return $js;
	}
} 



?>